package cn.itsource.ymcc.openfeign;

import cn.itsource.ymcc.domain.CourseDoc;
import cn.itsource.ymcc.openfeign.factory.SearchCourseOpenfeignFallbackFactory;
import cn.itsource.ymcc.result.JsonResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@FeignClient(value = "service-search",fallbackFactory = SearchCourseOpenfeignFallbackFactory.class)
public interface SearchCourseOpenfeign {
    @PostMapping("/search/course/save")
    public JsonResult save(@RequestBody CourseDoc courseDoc);

    @PostMapping("/search/course/bathSave")
    public JsonResult save(@RequestBody List<CourseDoc> courseDoc);

    @DeleteMapping("/search/course/del/{id}")
    public JsonResult save(@PathVariable("id") Long id);

    @GetMapping("/search/course/query")
    public JsonResult query();

    @GetMapping("/search/course/{courseId}")
    public JsonResult queryCourseDoc(@PathVariable("courseId") Long courseId);

    @PostMapping("/search/course/queryCourseDocByIds")
    public JsonResult queryCourseDocByIds(@RequestBody List<Long> ids);
}
